#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int mix = 0;
int max = 1;
void compare(int i,int k,int arr[100])
{
	if (i < k)
	{
		arr[99 - (k - i)]++;
		if (arr[99 - (k - i)] > mix)
		{
			mix = arr[99 - (k - i)];
		}
	}
	else if (i > k)
	{
		int a = 1;
		for (a; a <=99-(i-k); a++)
		{
			arr[a] = arr[a + i - k];
			if (arr[a] > mix && arr[a] != 0)
			{
				mix = arr[a];
			}
		}
		arr[99] = 0;
		arr[99]++;
	}
	else if (i == k)
	{
		arr[99]++;
		if (arr[99] > mix)
		{
			mix = arr[99];
		}
	}
}
int findmax(int arr[100])
{
	int a = 0;
	int b = 99;
	int sum = 0;
	while (b)
	{
		for (b; b > 0; b--)
		{
			if (arr[b] != 0)
			{
				a = arr[b];
				sum++;
				break;
			}
		}
		{
			for (b; b > 0; b--)
			{
				if (arr[b] < a && arr[b] != 0)
				{
					a = arr[b];
				}
			}
		}
	}
	return a;
}
int main()
{
	int n = 0;
	int k = 0;
	scanf("%d", &n);
	int arr[100] = { 0 };
	for (n; n > 0; n--)
	{
		int i = 0;
		int j = 0;
		scanf("%d", &i);
		compare(i,k,arr);
		if (i > k)
		{
			j = i;
			i = k;
			k = j;
		}
	}
	max=findmax(arr);
	printf("The min is %d\n", mix);
	printf("The max is %d", max);
	return 0;
}